package com.fast.develop.integration.orm.id;

import com.fast.develop.meta.base.MetaConfiguration;
import com.fast.develop.meta.dm.MetaDomainConstant;
import com.fast.develop.meta.dm.MetaDomainModel;
import com.fast.develop.meta.dm.MetaField;

import java.util.Map;

/**
 * @author 莫寅
 * @createTime 2022-06-21 03:29
 * @desc：
 */
public class MetaDomainModelsVisit {

    private MetaConfiguration metaConfiguration;

    public MetaDomainModelsVisit(MetaConfiguration metaConfiguration) {
        this.metaConfiguration = metaConfiguration;
    }


    private Map<String, MetaDomainModel> getMetaModels(){
        return metaConfiguration.getMetaModels(MetaDomainConstant.TYPE);
    }

    public MetaDomainModel getMeta(String meta){
        return getMetaModels().get(meta);
    }

    public MetaField getIdentifierProperty(String meta){
        return getMeta(meta).getIdentifierProperty();
    }
}
